import base from "./base"; // 导入接口域名列表
import axios from "../http"; // 导入http中创建的axios实例
import qs from "qs"; // 根据需求是否导入qs模块
const getim = {
  login_im(params) {
    return axios.post(
      `${base.bd}/admin/im_admin/login_im`,
      qs.stringify(params)
    );
  },
  getImUserInfo(params) {
    return axios.post(
      `${base.bd}/admin/user/im_user_info`,
      qs.stringify(params)
    );
  },
  material_find(params) {
    //素材列表
    return axios.post(
      `${base.bd}/admin/im_material/lists`,
      qs.stringify(params)
    );
  },
  material_add(params) {
    //素材添加
    return axios.post(
      `${base.bd}/admin/im_material/saveadd`,
      qs.stringify(params)
    );
  },
  material_edit(params) {
    //素材获得修改信息
    return axios.post(
      `${base.bd}/admin/im_material/edit`,
      qs.stringify(params)
    );
  },
  material_save(params) {
    //素材保存修改信息
    return axios.post(
      `${base.bd}/admin/im_material/saveedit`,
      qs.stringify(params)
    );
  },
  material_del(params) {
    //素材删除
    return axios.post(`${base.bd}/admin/im_material/del`, qs.stringify(params));
  },
  material_delall(params) {
    //素材批量删除
    return axios.post(
      `${base.bd}/admin/im_material/del_all`,
      qs.stringify(params)
    );
  },
  material_sort(params) {
    //素材排序
    return axios.post(
      `${base.bd}/admin/im_material/sort_by_number`,
      qs.stringify(params)
    );
  },
  modify_remark(params) {
    //修改备注
    return axios.post(`${base.bd}/admin/user/saveedit`, qs.stringify(params));
  },
  im_attention(params) {
    return axios.post(
      `${base.bd}/admin/user/im_attention`,
      qs.stringify(params)
    );
  },
  attention_list(params) {
    return axios.post(
      `${base.bd}/admin/user/im_attention_lists`,
      qs.stringify(params)
    );
  },
  get_welcome(params) {
    return axios.post(
      `${base.bd}/admin/im_material/welcome`,
      qs.stringify(params)
    );
  },
  edit_welcome(params) {
    //修改欢迎语
    return axios.post(
      `${base.bd}/admin/im_material/welcome`,
      qs.stringify(params)
    );
  },
  get_robotlist(params) {
    //机器人列表
    return axios.post(`${base.bd}/admin/im_text/lists`, qs.stringify(params));
  },
  add_robotlist(params) {
    //添加机器人
    return axios.post(`${base.bd}/admin/im_text/saveadd`, qs.stringify(params));
  },
  find_robotlist(params) {
    //查询一条数据
    return axios.post(`${base.bd}/admin/im_text/edit`, qs.stringify(params));
  },
  edit_robotlist(params) {
    //保存修改
    return axios.post(
      `${base.bd}/admin/im_text/saveedit`,
      qs.stringify(params)
    );
  },
  del_robotlist(params) {
    //单条删除和批量删除
    return axios.post(`${base.bd}/admin/im_text/del_all`, qs.stringify(params));
  },

  get_imuserlist(params) {
    return axios.post(`${base.bd}/admin/im_user/lists`, qs.stringify(params));
  },
  add_imuserlist(params) {
    return axios.post(`${base.bd}/admin/im_user/saveadd`, qs.stringify(params));
  },
  edit_imuserlist(params) {
    return axios.post(
      `${base.bd}/admin/im_user/saveedit`,
      qs.stringify(params)
    );
  },
  del_imuserlist(params) {
    return axios.post(`${base.bd}/admin/im_user/del`, qs.stringify(params));
  },

  sendImMessage(params) {
    return axios.post(`${base.bd}/admin/im_user/sms`, qs.stringify(params));
  },
  
};
export default getim;
